<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
		"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>_Widget deferred connection test</title>
	<style type="text/css">
		@import "../../dojo/resources/dojo.css";
		@import "../themes/tundra/tundra.css";
		@import "css/dijitTests.css";
	</style>

	<script type="text/javascript" src="../../dojo/dojo.js"
		djConfig="isDebug: true, parseOnLoad: true"></script>
	<script>
		dojo.require("dijit.form.Button");

		function bothHandler(){
			console.log("'both' button: overrode handler called");
			bothOverrodeMouseMoved = true;
		}

		dojo.addOnLoad(function(){
			dojo.connect(dijit.byId("connect"), "onMouseMove", function(){
				console.log("'connect' button: mouse moved");
				connectedMouseMoved = true;
			});

			dojo.connect(dijit.byId("both"), "onMouseMove", function(){
				console.log("'both' button: connected handler");
				bothConnectedMouseMoved = true;
			});			
		});

	</script>
</head>
<body class="tundra">
	<h1>Test deferred connections</h1>
	<p>
		OnMouseMove is a deferred connection, _Widget only call dojo.connect()
		(dojoAttachEvent) to connect the onmousemove event on the focusNode to
		the widget method if needed.
	</p>
	<p>
		Mousing over the three buttons below should call the user-defined mouse-move
		handlers.  The "both" button has two handlers, and they should both be called.
	</p>

	<!--
		"overrode" button specifies an onmousemove handler on initialization.
	-->
	<button id="overrode" dojoType="dijit.form.Button"
		onMouseMove="console.log('\'overrode\' button: mouse moved'); overrodeMouseMoved = true;">
		overrode
	</button>

	<!--
		"connect" button essentially is doing a dojo.connect("connect", "onMouseMove", myFunc).
		This should trigger an additional dojo.connect() call from Button.focusNode.onmousemove
		to the Button.onMouseMove empty function. 
	-->
	<button id="connect" dojoType="dijit.form.Button">
		connected
	</button>

	<button id="both" dojoType="dijit.form.Button" onMouseMove="bothHandler">
		both
	</button>
</body>
</html>
